#ifndef ___logger_h___
#define ___logger_h___

#include <iostream>
#include <string>

#include <boost/asio.hpp>
#include <boost/bind.hpp>
#include <boost/thread.hpp>

/*
 * Thread safe log printer
 *
 */
class logger
{
public:
    template<typename MessageType>
    static void print(MessageType msg);
private:
    logger();
    ~logger();

    void print_handler(std::string msg);

    boost::asio::io_service io_service;
    boost::asio::io_service::work work;

    boost::thread* thread;

    static logger* instance;
    static boost::mutex instance_mutex;

};




#endif // ___logger_h___
